import ItemMoudle from "@/components/common/ItemModule"
import TableIndex from "@/components/common/TableIndex"
import TitleMain from "@/components/common/TitleMain"
import type { ColumnsType } from "antd/es/table"



interface DataType {
  type: string
  grade: string
  key: string
  a: string
  c: string
}

const columns: ColumnsType<DataType> = [

  {
    title: '类型',
    dataIndex: 'type',
    ellipsis: true,
    width: 90

  },
  {
    title: '风险等级',
    dataIndex: 'grade',
    width: 90
  },
  {
    title: '发现时间',
    dataIndex: 'a',
    width: 90
  },
  {
    title: '状态',
    dataIndex: 'c',
    width: 70
  },
];

const dataSource: DataType[] = [];
for (let i = 0; i < 46; i++) {
  dataSource.push({
    type: `SQL注入`,
    grade: `高风险`,
    key: `${i}`,
    a: '2025-10-19',
    c: '已处理'
  });
}



const BugSituation = () => {
  return <ItemMoudle
    className="w-[384px]"
    childClassName="h-[366px] flex items-center justify-between"
    header={
      <TitleMain title="漏洞情况" />
    }
  >

    <TableIndex<DataType>
      columns={columns}
      data={dataSource}
      scroll={{ y: 290, x: 360 }}
    />

  </ItemMoudle>
}

export default BugSituation